package cgl.hadoopsensorgrid.sensorgrid.util;

import java.io.IOException;
import java.io.File;
import java.io.FileWriter;

/***
 * 
 * Log running status for testing.
 * 
 * @author Chao Sun
 * 
 */
public class testingLog {
	
	public testingLog() {
	}
	
	/**
	 * Log the status into file.
	 * 
	 * @param logDir
	 *          Directory path of the log file
	 * @param logText
	 *          Text contents to be logged into file
	 * 
	 * @throws IOException
	 */
	public static void log(String logDir, String logText) throws IOException {
		String logFile = logDir + "log.txt";
		
		FileWriter filewriter = new FileWriter(logFile, true);
		filewriter.write(logText + "\n");
		filewriter.flush();
		filewriter.close();
	}
	
}